import request from '@/utils/request'

interface IMenuPermission{
    list: IPermissions[]
}

// 查询所有菜单权限
export const getAllMenuPermissions = () => request.get<any, IMenuPermission>('/api/v1/admin/permissions')

// 查询所有菜单权限树
export const addMenuPermission = (data: IPermissions) => request.post('/api/v1/admin/permissions', data)

// 修改菜单权限数据
export const updateMenuPermission = (data: IPermissions) => request.put('/api/v1/admin/permissions/' + data.id, data)

// 删除菜单权限
export const deleteMenuPermission = (id: string) => request.delete('/api/v1/admin/permissions/' + id)